<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        *{
            margin: 0;
            padding: 0;
        }
        .box{
            width: 250px;
            margin: 100px auto;
        }
        .box li{
            float: left;
            width: 24px;
            height: 24px;
            /* border: 1px solid black; */
            /* background-color: pink; */
            margin: 15px;
            list-style-type: none;
            background-image: url(images/sprite.png);
            background-repeat: no-repeat;
        }
    </style>
</head>
<body>
    <div class="box">
        <ul>
            <li></li>
            <li></li>
            <li></li>
            <li></li>
            <li></li>
            <li></li>
            <li></li>
            <li></li>
            <li></li>
            <li></li>
            <li></li>
            <li></li>
        </ul>
    </div>
    <script>
        var lis = document.querySelectorAll('li');
        // console.log(lis);
        for(var i = 0; i<lis.length; i++){
            var index = i *44;
            lis[i].style.backgroundPosition = '0 -' + index + 'px';
        }
    </script>
</body>
</html>